<script src="/html/scripts/shop/shop.js"></script>


<div class="new_bd clearfix">
        <div class="cart-litad spbg2">
            <strong>WOW!</strong>
            <span>
                <span>Free Shipping</span>
                <span class="spbg2">Free Returns</span>
                <span class="spbg2">Free 365 Day Return Policy</span>
                <span class="spbg2">24/7 Customer Service</span>
            </span>
        </div>
    	<div class="new_mn clearfix">

    		<b class="spbg2 corner tl"></b>

    		<b class="spbg2 corner tr"></b>

    		<b class="spbg2 corner bl"></b>

    		<b class="spbg2 corner br"></b>

    		<div class="titlebar clearfix">CURRENTLY IN YOUR SHOPPING CART</div>

    		<?php if (count($this->itemArray) > 0):?>
    		<?php $l = 1;?>
    		<?php if (!empty($_COOKIE[COOKIE_PRE . 'product_coupon_id'])):?>
    		<?php $itemArr = explode(',',$_COOKIE[COOKIE_PRE . 'product_coupon_id']);$l = 0;?>
    		<?php foreach ($this->itemArray as $v):?>
    			<?php     				
    				if (!in_array($v['itemid'], $itemArr)) {
    					$l = 1;
    					break;
    				}
    			?>
    		<?php endforeach;?>
    		<?php endif;?>

    		<div class="content_s clearfix">

    			<h2>You have <font><?php echo $this->showItemCounts;?></font> items in your shopping cart</h2>

    			<span class="safe">Buying from <?php echo SITE_NAME;?> is safe. Your order will be processed on our secure servers.</span>

    			<div class="csorco">

    				<span class="continue"><input type="button" class="spbg2 continue_btn" value="CONTINUE SHOPPING" onclick="window.location.href='<?php echo MY_URL;?>'"/></span>

    				<span class="info">&nbsp;&nbsp;&nbsp;&nbsp;Not Your Shopping Cart? <a href="javascript:void(0);" onclick="GGSHOP.clearcart.clear();">Remove All Items.</a></span>
    				<span class="spbg2 checkout"><a href="javascript:void(0);" onclick="<?php if ($l == 1):?>addcontact();<?php else:?>GGSHOP.msgBox.show('ERROR', 'You must choose at least one another product!');<?php endif;?>return false; ">PROCEED TO CHECKOUT</a></span>

    			</div>

    		</div>    		

    		<div class="items clearfix">    		

    			<ul>
    				<?php if(!empty($this->presalerow)):?>
					<li class="title" style="padding-left:40px;color:red;width:810px;height:60px;">
						You have paid part of this product, you can continue to pay the left money to get it or remove it from the cart, so that you can put other product into the shopping cart.
						<a href="/tool-remove">Remove it?</a>
    				</li>
    				<?php else:?>
    				<li class="title" style="padding-left:40px;color:red;width:810px;height:30px;">
						If you have some backorder item, please check you email, and follow the link we send to pay for it.				
    				</li>
    				<?php endif;?>
    				<li class="title">

    					<span class="itemc">Your Item</span>

    					<span class="itemp">Item Price</span>

    					<span class="itemq">Quantity</span>

    					<span class="itempt">Price</span>

    				</li>
    				<?php foreach ($this->itemArray as $v):?>

	    				<li>

	    					<span class="itemc">

	    						<span class="pic"><img src="<?php echo $v['cut_url'];?>" onerror="javascript:this.src ='<?=MY_URL?>/html/images/nothingpic.jpg'" alt="<?=$value['subject']?>" width="151" height="151"/></span>

	    						<span class="desc" style="word-wrap:break-word;">

	    							<a href="<?php echo $this->url($v['itemid']);?>"><?echo $v['subject'];?></a><br />

	    							<strong>SKU: </strong>#<?php echo substr(time(),0,4) . $v['itemid'];?><br />

	    							<strong>Unit: </strong><?php echo $v['unit'];?><br />

	    							<input type="hidden" name="pattern_name[]" value="<?php echo $v['pattern_name'];?>" />

	    							<input type="hidden" name="pattern_size[]" value="<?php echo $v['buy_pattern_size'];?>" />

	    							<input type="hidden" value="<?php echo $v['itemid'];?>" name="itemArray[]" />

	    							<input type="hidden" name="min_counts" value="<?php echo $v['min_counts'];?>" />

	    							<input type="hidden" name="max_counts" value="<?php echo $v['max_counts'];?>" />

	    							<strong>SIZE: </strong><?php echo $v['buy_pattern_size'];?><br />

									<strong>Memo: </strong><?php echo $v['printMesg'];?><br />
									<?php if($v['accessory']):?>
									<strong>Accessory: </strong><br />
									<div class="peijian"><?php echo $v['accessory'];?></div>
									<?php endif;?>
	    						</span>

	    					</span>

	    					<span class="itemp"><span style="color:#F00;" class="delete"><?php if(!empty($this->presalerow)):?>$<?=$this->numberFormat($v['net_price_org']+$this->presalerow[0]['preprice'],2)?><?php endif;?></span><br><strong style="color:#F00;">$<?=$this->numberFormat($v['net_price_org'],2)?>
	    					</strong>
	    					</span>

	    					<span class="itemq">

	    						<?php echo $v['amounts'];?><br />

	    						<br />

	    						<a class="spbg2 remove" href="product-remove?itemid=<?echo $v['itemid'];?>&pattern_name=<?=urlencode($v['pattern_name'])?>">Remove</a><br />

	    						<a class="spbg2 favorite" onclick="myFavorite.addItemFavor('<?php echo $v['itemid'];?>');" href="javascript:void(0);">Move to Favorites</a>

	    					</span>

	    					<span class="itempt"><strong>$
		    					<?php if($v['buy_name_num'] != '' or $v['buy_originalname_num'] != ''):?>

						            <?php if ($v['buy_BadgePatch'] == 'Yes'):?>

						    		<?php echo $this->numberFormat($v['net_price_org']*$v['amounts'] + $v['printAmounts']*PRINT_CUSTOM_PRICE + $v['originalprintAmounts']*PRINT_ORIGINAL_PRICE + $v['badge_patch_money']+$v['accessory_money'], 2);?>

						    	    <?php else:?>

						    		<?php echo $this->numberFormat($v['net_price_org']*$v['amounts'] + $v['printAmounts']*PRINT_CUSTOM_PRICE + $v['originalprintAmounts']*PRINT_ORIGINAL_PRICE +$v['accessory_money'], 2);?>

						    	    <?php endif;?>

						    	<?php else:?>

						            <?php if( $v['buy_BadgePatch'] == 'Yes'):?>

						                <?php echo $this->numberFormat($v['net_price_org']*$v['amounts']+$v['badge_patch_money']+$v['accessory_money'], 2);?>

						    	    <?php else:?>

						    			<?php echo $this->numberFormat($v['net_price_org']*$v['amounts'] +$v['accessory_money'],2)?>

						    	    <?endif;?>   		

						    	<?endif;?>  

	    					</strong></span>

	    				</li>

    				<?php endforeach;?>

    			</ul>
    		</div>			
            <?php             	
            	if ($this->validatePrize) {
            		$amount = $this->totalPrice;   
            		$memberDollar = 0;     
            	} else {
            		$memberDollar = MEMBER_DOLLAR;  
            		$amount = $this->totalPrice - MEMBER_DOLLAR;
            		$amount = $amount - 1;
            	}
            	if ($this->userDollar >= $amount) {
		        	$useDollar = $amount;
		        } else {
		        	$useDollar = $this->userDollar;
		        }
            ?>
            <?php if ($this->hasLog):?>
            	<input type="hidden" name="usecoupon" value=""></input>
	            <input type="hidden" name="usercoupon" value="<?php echo $this->userDollar;?>"></input>
            	<input type="hidden" value="<?php echo $useDollar?>" name="coupon" />
            	<script type="text/javascript">
            		var total = <?php echo $this->totalPrice;?>;
            		var discount = <?php echo $memberDollar;?>;
            		function changeCoupon()
            		{
                		totalPriceAll = total - discount;
            			$('input[name="usecoupon"]').val($('input[name="coupon"]').val());                			
                		if (($('input[name="usecoupon"]').val() - $('input[name="usercoupon"]').val()) > 0 || ($('input[name="usecoupon"]').val() - totalPriceAll) > 0) {
                			GGSHOP.msgBox.show('ERROR', 'You input coupon too more!');		
                			return false;
                		}	
                		if ($('input[name="usecoupon"]').val() > 0) {
                			totalPriceAll = totalPriceAll - $('input[name="usecoupon"]').val();
                		}	
                		$('#total2').html(totalPriceAll);
                		save = formatfloat($('input[name="usecoupon"]').val(),2)+ discount;
                		$('#total3').html(save);
                	}
                	function addcontact()
                	{
                		GGSHOP.loading.show();
						changeCoupon();
						document.cookie= "msg="+encodeURI($('textarea').val());
						window.location.href="/product-tip?coupon="+$('input[name="usecoupon"]').val();
                    }
            	</script>
            <?php else:?>
            	<input type="hidden" name="coupon_code" />
            	<script type="text/javascript">
            		function addcontact()
            		{
            			GGSHOP.loading.show();
            			document.cookie= "msg="+encodeURI($('textarea').val());
            			window.location.href="/product-tip?code="+$('input[name="coupon_code"]').val();
                	}
            	</script>
            <?php endif;?>           
    		<div class="content_s clearfix">
    			<div>
    				<p>Remark:<br/><br/></p>
    				<textarea name="msg" style="width:810px; height:100px;"></textarea>
    			</div>

    			<div class="subtotal">
				<?php if ($this->hasLog):?>
					<?php /**black coupon can use**/?>
					<?php $canUseCoupon = 0;?>
					<?php if(!defined('SELL_VALIDATE')):?>
						<?php if($this->numberFormat($this->totalPrice - $memberDollar-$useDollar,2)>59.00):?>
						<?php $canUseCoupon = 1;?>
						<?php endif;?>
					<?php else:?>
						<?php if($this->numberFormat(($this->totalPrice - $memberDollar-$useDollar) * (1-SELL_OFF),2)>59.00):?>
						<?php $canUseCoupon = 1;?>
						<?php endif;?>					
					<?php endif;?>
					<?php /**black coupon can use**/?>
					
					<?php if(!defined('SELL_VALIDATE')):?>
						<?php if($this->numberFormat($this->totalPrice - $memberDollar-$useDollar,2)>59.00):?>
						<span class="coupon-item"><strong>Coupon Code: </strong><input id="couponCodeInput" type="text" /> <a href="#" id="applyCouponCode" class="acouponCode spbg f-iblk">Apply</a>
						<?php endif;?>
					<?php else:?>
						<?php if($this->numberFormat(($this->totalPrice - $memberDollar-$useDollar) * (1-SELL_OFF),2)>59.00):?>
						<span class="coupon-item"><strong>Coupon Code: </strong><input id="couponCodeInput" type="text" /> <a href="#" id="applyCouponCode" class="acouponCode spbg f-iblk">Apply</a>
						<?php endif;?>					
					<?php endif;?>
					
					
					
					<span style="font-size:10px;">Like us on <a style="text-decoration:underline;" target="_blank" href="http://www.facebook.com/newjerseysoccer.Soccer.Jersey?v=app_174961479209942">Facebook</a>, take a chance to get a $100 coupon.</span></span>
    				<span style="line-height: 30px;">SUBTOTAL (<?php echo $this->showItemCounts;?> ITEM):&nbsp;&nbsp;&nbsp;&nbsp;<strong>$<?=$this->numberFormat($this->totalPriceOrg,2)?></strong></span>
					<?php if ($canUseCoupon):?>
					<span style="line-height: 25px;font-weight: bold;font-size: 12px;">Coupon Cash: -$<?php echo $useDollar+$this->couponInfo['money'];?></span>
					<?php endif;?>
					<span style="line-height: 25px;font-weight: bold;font-size: 12px;color: #cc0000;">Grand Total: <strong style="color: #cc0000;">
					<?php

						$price = $this->totalPrice - $memberDollar-$useDollar;
						
							
						if (!defined('SELL_VALIDATE')) {		
							echo '$' . $this->numberFormat($price,2);
						} else {
							echo '$' . $this->numberFormat($price * (1-SELL_OFF),2);
						}
					?></strong></span>
					<?php if($this->black_friday):?><span style="line-height: 25px;font-size: 14px;color: #cc0000;font-weight: bold;">Order over $399: $100 off</span><?php endif;?>
					<span style="line-height: 25px;font-size: 14px;font-weight: bold;">SAVED: $
					<?php
					
					if (!defined('SELL_VALIDATE')) {
						echo $this->numberFormat($this->totalPriceOrg - $price, 2);
					} else {
						echo $this->numberFormat(($this->totalPriceOrg - $price) + $price * SELL_OFF, 2);
					}
					?>
					</span>
				<?php else:?>
				
					<?php
					
					if(!defined('SELL_VALIDATE')):?>
						<?php if($this->numberFormat($this->totalPrice,2)>59.00):?>
						<span class="coupon-item"><strong>Coupon Code: </strong><input id="couponCodeInput" type="text" /> <a href="#" id="applyCouponCode" class="acouponCode spbg f-iblk">Apply</a>
						<?php endif;?>
					<?php else:?>
						<?php if($this->numberFormat($this->totalPrice*(1-SELL_OFF),2)>59.00):?>
						<span class="coupon-item"><strong>Coupon Code: </strong><input id="couponCodeInput" type="text" /> <a href="#" id="applyCouponCode" class="acouponCode spbg f-iblk">Apply</a>
						<?php endif;?>
					
					<?php endif;?>
				
				
				
				
				
				
				
					<span style="font-size:10px;">Like us on <a style="text-decoration:underline;" target="_blank" href="http://www.facebook.com/newjerseysoccer.Soccer.Jersey?v=app_174961479209942">Facebook</a>, take a chance to get a $100 coupon.</span></span>
					<span style="line-height: 30px;color: #767676;">SUBTOTAL (<?php echo $this->showItemCounts;?> ITEM):&nbsp;&nbsp;&nbsp;&nbsp;<strong>$<?=$this->numberFormat($this->totalPriceOrg,2)?></strong></span>
					<span style="line-height: 25px;font-size: 14px;color: #6c6c6c;">Grand Total: <strong style="color: #cc0000;">
					<?php 	
						$price = $this->totalPrice-$useDollar;	
						if (!defined('SELL_VALIDATE')) {		
							echo '$' . $this->numberFormat($price,2);
						} else {
							echo '$' . $this->numberFormat($price * (1-SELL_OFF),2);
						}
					?></strong></span>
					<?php if($this->black_friday):?><span style="line-height: 25px;font-size: 14px;color: #cc0000;font-weight: bold;">Order over $399: $100 off</span><?php endif;?>
					
					<span style="line-height: 25px;font-size: 14px;font-weight: bold;">SAVED: $
					<?php 
					if (!defined('SELL_VALIDATE')) {
						echo $this->numberFormat($this->totalPriceOrg - $this->totalPrice, 2);
					} else {
						
						echo $this->numberFormat(($this->totalPriceOrg - $this->totalPrice) + $price * SELL_OFF, 2);
					}
					?></span>
				<?php endif;?>
    				<!-- <span>STANDARD OVERNIGHT SHIPPING:&nbsp;&nbsp;&nbsp;&nbsp;<b class="free">FREE</strong></span>

    				<span>* ESTIMATED TAX TO BE COLLECTED:&nbsp;&nbsp;&nbsp;&nbsp;<strong>$0.00</strong></span>-->

    			</div>

    		</div>
    		<div class="content_s clearfix">

    			<div class="csorco clearfix">

    				<span class="continue"><input type="button" class="spbg2 continue_btn" value="CONTINUE SHOPPING" onclick="window.location.href='<?php echo MY_URL;?>'"/></span>

    				<span class="spbg2 checkout"><a href="javascript:void(0);" onclick="<?php if ($l == 1):?>addcontact();<?php else:?>GGSHOP.msgBox.show('ERROR', 'You must choose at least one another product!');<?php endif;?>return false;">PROCEED TO CHECKOUT</a></span>


    			</div>

    			<div class="service clearfix">

    				<!-- <span>Shipping and Returns Policy | <a href="">Privacy Policy</a></span> -->

    				<span class="margint"><strong>Have questions? Prefer to order by <a target="_blank" href="http://chat.5251.net/client.jsp?flag=1&companyId=8522&style=18846&locate=en">Live Chat</a>? The Jersey Customer Loyalty Team is happy to help!</strong></span>

    				<span class="marginb"><strong>Call 24 hours a day – 365 days a year.</strong></span>

    				<!--  <span>(000) 000-0000 or Email our Customer Loyalty Team</span>-->

    			</div>

    		</div>

    		<?php else:?>

    			<div class="items clearfix">    		

    				<?php echo $this->getMsg('No shopping list!');?>

    			</div>

    		<?php endif;?>

    	</div>
    	<div class="new_also_like clearfix">
	    	<div class=privous></div>
	    	<div class="showbox ">
	    		<div class="ulbox">
				<ul class="clearfix">
					<?php for ($i=0; $i < count($this->interrelatedArray); $i++):?>
					<li>
						<span class="img">
							<a href="<?php echo $this->url($this->interrelatedArray[$i]['itemid']);?>"><img alt="<?php echo $this->interrelatedArray[$i]['subject'];?>" title="<?php echo $this->interrelatedArray[$i]['subject'];?>" width="126" style="max-height: 150px" src="<?php echo $this->interrelatedArray[$i]['cut_url'];?>" /></a>
							<span class="icon"></span>
						</span>
						<span class="desc">
							<a href="<?php echo $this->url($this->interrelatedArray[$i]['itemid']);?>"><?php echo $this->interrelatedArray[$i]['subject'];?></a>
						</span>
						<span class="strong">
							<?if($this->interrelatedArray[$i]['min_price']!=$this->interrelatedArray[$i]['max_price']):?>
							Price <font class="delete">$<?php echo $this->interrelatedArray[$i]['m_org_price'];?></font> $<?=$this->interrelatedArray[$i]['max_price']?> 
							<?else:?>
							Price <font class="delete">$<?php echo $this->interrelatedArray[$i]['m_org_price'];?></font> $<?=$this->interrelatedArray[$i]['max_price']?> 
							<?endif;?>
						</span>
					</li>
					<?php endfor;?>
				</ul>
				</div>
			</div>
	    	<div class=next></div>
	    </div>

    </div>
    <script type="text/javascript">
$(function(){
	var $cur = 1;
	var $i = 5;
	var $len = $('.ulbox>ul>li').length;
	//alert($len);return false;
	var $pages = Math.ceil($len / $i);
	//fillPages($pages);
	var $w = 181*5+5;
	var $showbox = $('.ulbox');
	var $pre = $('div.privous');
	var $next = $('div.next');
	///var $autoFun;
	//var $autoFun1;
	//autoSlide();
	$pre.click(function(){
		//alert(1);return false;
		if (!$showbox.is(':animated')) {
			if ($cur == 1) {
				$showbox.animate({left: '-=' + $w * ($pages - 1)},500);
				$cur = $pages;
			}
			else {
				$showbox.animate({left: '+=' + $w},500);
				$cur--;
			}
			//$num.eq($cur - 1).addClass('numcur').siblings().removeClass('numcur');
		}
	});
	$next.click(function(){
		//alert(1);return false;
		if (!$showbox.is(':animated')) {
			if ($cur == $pages) {
				$showbox.animate({left: 0},500);
				$cur = 1;
			}
			else {
				$showbox.animate({left: '-=' + $w},500);
				$cur++;
			}
			//$num.eq($cur - 1).addClass('numcur').siblings().removeClass('numcur');
		}
	});
//	$num.click(function(){
//		if (!$showbox.is(':animated')) {
//			var $index = $num.index(this);
//			$showbox.animate({left: '-' + ($w * $index)},500);
//			$cur = $index + 1;
//			$(this).addClass('numcur').siblings().removeClass('numcur');
//		}
//	});
	function fillPages(pages)
	{
		pages_str = "";
		for(i=1;i<=pages;i++)
		{
			if(i==1)
				pages_str += "&nbsp;<a href='javascript:;' class='numcur'>"+i+"</a>&nbsp;";
			else
				pages_str += "&nbsp;<a href='javascript:;'>"+i+"</a>&nbsp;";
		}
		$('span.num').html(pages_str);
	}
	function clearFun(elem){
		elem.hover(function(){clearAuto();},function(){autoSlide();});
	}
	function autoSlide(){
		$autoFun = setTimeout(autoSlide, 3000);
		$autoFun1 = setTimeout(autoSlide1, 3000);
	}
	function autoSlide1(){
		$next.trigger('click');
	}
	function clearAuto(){
		clearTimeout($autoFun);
		clearTimeout($autoFun1);
	}
	
	$('#applyCouponCode').click(function(){
		var _code = trim($('#couponCodeInput').val());
		if(_code==''){
			GGSHOP.msgBox.show('Message', 'Please input your coupon code.');	
		}else{
			GGSHOP.loading.show();
			$.post(ROOT_PATH+"/help-coupon",{code:_code},function(data) {
				if(trim(data)=='0'){
					alert("Please log in first.");
					window.location.href="/auth-login?preurl=/product-showitem";
				}else if(trim(data)=='1'){
					$('#couponCodeInput').val('');
					window.location.reload();
				}else if(trim(data)=='2'){
					GGSHOP.loading.hidden();
					GGSHOP.msgBox.show('Message', 'Your coupon code has been expired.');	
				}else if(trim(data)=='5'){
					GGSHOP.loading.hidden();
					GGSHOP.msgBox.show('Message', 'Your coupon code has been used.');	
				}else if(trim(data)=='6'){
					GGSHOP.loading.hidden();
					GGSHOP.msgBox.show('Message', 'Your 13thanks couponcode has not been used');
				}else{
					GGSHOP.loading.hidden();
					GGSHOP.msgBox.show('Message', 'Sorry. Your coupon code is invalid.');		
				}
			});	
		}
		return false;
	});
	
	//clearFun($showbox);
	//clearFun($pre);
	//clearFun($next);
	//clearFun($num);
});
</script>